<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    
    <title>jouyouyun&#39;s blog</title>
    <meta name="viewport" content="width=device-width,minimum-scale=1">
    <meta name="description" content="jouyouyun&#39;s blog.">
    <meta name="generator" content="Hugo 0.105.0">
    
    
    
    
      <meta name="robots" content="noindex, nofollow">
    

    
<link rel="stylesheet" href="/ananke/css/main.min.css" >



    
    
    
      

    

    
    
      <link href="/post/index.xml" rel="alternate" type="application/rss+xml" title="jouyouyun&#39;s blog" />
      <link href="/post/index.xml" rel="feed" type="application/rss+xml" title="jouyouyun&#39;s blog" />
      
    
    
    <meta property="og:title" content="Posts" />
<meta property="og:description" content="jouyouyun&#39;s blog." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://jouyouyun.github.io/post/" />

<meta itemprop="name" content="Posts">
<meta itemprop="description" content="jouyouyun&#39;s blog."><meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="Posts"/>
<meta name="twitter:description" content="jouyouyun&#39;s blog."/>

	
  </head>

  <body class="ma0 avenir bg-near-white">

    

  <header>
    <div class="pb3-m pb6-l bg-black">
      <nav class="pv3 ph3 ph4-ns" role="navigation">
  <div class="flex-l justify-between items-center center">
    <a href="/" class="f3 fw2 hover-white no-underline white-90 dib">
      
        jouyouyun&#39;s blog
      
    </a>
    <div class="flex-l items-center">
      

      
        <ul class="pl0 mr3">
          
          <li class="list f5 f4-ns fw4 dib pr3">
            <a class="hover-white no-underline white-90" href="/post/" title="Archives 页">
              Archives
            </a>
          </li>
          
          <li class="list f5 f4-ns fw4 dib pr3">
            <a class="hover-white no-underline white-90" href="/tags/" title="Tags 页">
              Tags
            </a>
          </li>
          
          <li class="list f5 f4-ns fw4 dib pr3">
            <a class="hover-white no-underline white-90" href="/categories/" title="Categories 页">
              Categories
            </a>
          </li>
          
        </ul>
      
      
<div class="ananke-socials">
  
    <a href="https://github.com/jouyouyun" target="_blank" class="github ananke-social-link link-transition stackoverflow link dib z-999 pt3 pt0-l mr1" title="GitHub link" rel="noopener" aria-label="follow on GitHub——Opens in a new window">
      
        <span class="icon"><svg style="enable-background:new 0 0 512 512;" version="1.1" viewBox="0 0 512 512"  xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" >
  <path d="M256,32C132.3,32,32,134.8,32,261.7c0,101.5,64.2,187.5,153.2,217.9c11.2,2.1,15.3-5,15.3-11.1   c0-5.5-0.2-19.9-0.3-39.1c-62.3,13.9-75.5-30.8-75.5-30.8c-10.2-26.5-24.9-33.6-24.9-33.6c-20.3-14.3,1.5-14,1.5-14   c22.5,1.6,34.3,23.7,34.3,23.7c20,35.1,52.4,25,65.2,19.1c2-14.8,7.8-25,14.2-30.7c-49.7-5.8-102-25.5-102-113.5   c0-25.1,8.7-45.6,23-61.6c-2.3-5.8-10-29.2,2.2-60.8c0,0,18.8-6.2,61.6,23.5c17.9-5.1,37-7.6,56.1-7.7c19,0.1,38.2,2.6,56.1,7.7   c42.8-29.7,61.5-23.5,61.5-23.5c12.2,31.6,4.5,55,2.2,60.8c14.3,16.1,23,36.6,23,61.6c0,88.2-52.4,107.6-102.3,113.3   c8,7.1,15.2,21.1,15.2,42.5c0,30.7-0.3,55.5-0.3,63c0,6.1,4,13.3,15.4,11C415.9,449.1,480,363.1,480,261.7   C480,134.8,379.7,32,256,32z"/>
</svg>
</span>
      
<span class="new-window"><svg  height="8px"  style="enable-background:new 0 0 1000 1000;" version="1.1" viewBox="0 0 1000 1000"  xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" >
<path d="M598 128h298v298h-86v-152l-418 418-60-60 418-418h-152v-86zM810 810v-298h86v298c0 46-40 86-86 86h-596c-48 0-86-40-86-86v-596c0-46 38-86 86-86h298v86h-298v596h596z" style="fill-rule:evenodd;clip-rule:evenodd;"/>
</svg>
</span></a>
  
</div>

    </div>
  </div>
</nav>

      <div class="tc-l pv3 ph3 ph4-ns">
        <h1 class="f2 f-subheadline-l fw2 light-silver mb0 lh-title">
          Posts
        </h1>
        
      </div>
    </div>
  </header>


    <main class="pb7" role="main">
      

  <article class="pa3 pa4-ns nested-copy-line-height">
    <section class="cf ph3 ph5-l pv3 pv4-l f4 tc-l center measure-wide lh-copy mid-gray">
      
    </section>
    <aside class="flex-ns flex-wrap justify-around mt5">
      
        <div class="relative w-100 w-30-l mb4 bg-white">
            <div class="mb3 pa4 mid-gray overflow-hidden">
    
      <div class="f6">
        五月 2, 2019
      </div>
    
    <h1 class="f3 near-black">
      <a href="/post/installation/" class="link black dim">
        系统安装二三事
      </a>
    </h1>
    <div class="nested-links f5 lh-copy nested-copy-line-height">
      <p>在重装系统时, 需要考虑软件与数据的备份恢复, 遂记录下需要用到的软件, 自定义的配置和数据恢复.</p>
<h2 id="软件">软件</h2>
<h3 id="换源">换源</h3>
<ul>
<li><code>Archlinux</code></li>
</ul>
    </div>
  </div>

        </div>
      
        <div class="relative w-100 w-30-l mb4 bg-white">
            <div class="mb3 pa4 mid-gray overflow-hidden">
    
      <div class="f6">
        四月 21, 2019
      </div>
    
    <h1 class="f3 near-black">
      <a href="/post/jenkins-api-usage/" class="link black dim">
        Jenkins API 使用
      </a>
    </h1>
    <div class="nested-links f5 lh-copy nested-copy-line-height">
      <p><code>Jenkins</code> 是一款流行的开源持续集成工具，可以用来做一些软件开发的自动化工作，如打包，测试，自动部署等。</p>
<p><code>Jenkins</code> 中有 <code>view</code> 和 <code>job</code> 的概念， <code>view</code> 相当于组， <code>job</code> 则是具体的任务。
<code>view</code> 下面可以创建 <code>job</code> ，但 <code>job</code> 可以不在任何 <code>view</code> 下。</p>
<p>这里主要介绍 <code>Jenkins</code> 提供的 <code>HTTP API</code> ，至于如何使用 <code>Jenkins</code> 请参看 <a href="https://jenkins.io/doc/">Jenkins User Documentation</a>。</p>
    </div>
  </div>

        </div>
      
        <div class="relative w-100 w-30-l mb4 bg-white">
            <div class="mb3 pa4 mid-gray overflow-hidden">
    
      <div class="f6">
        四月 21, 2019
      </div>
    
    <h1 class="f3 near-black">
      <a href="/post/docker-data-storage/" class="link black dim">
        更改 Docker 数据的存储目录
      </a>
    </h1>
    <div class="nested-links f5 lh-copy nested-copy-line-height">
      <p><code>Docker</code> 安装后默认将数据存储在 <code>/var/lib/docker</code> 下，随着 <code>image</code> 和 <code>container</code> 的增多，会导致 <code>/</code> 分区的空间被用完，如果 <code>/</code> 分区特别大就请忽略这篇文章。</p>
<p>因此需要将一些软件的数据存储到空间大的分区，与 <code>/</code> 分区分开。不仅 <code>Docker</code> 需要这样处理，如 <code>mysql/postgresql</code> 等软件也需要这样处理。</p>
    </div>
  </div>

        </div>
      
        <div class="relative w-100 w-30-l mb4 bg-white">
            <div class="mb3 pa4 mid-gray overflow-hidden">
    
      <div class="f6">
        四月 21, 2019
      </div>
    
    <h1 class="f3 near-black">
      <a href="/post/docker-intro/" class="link black dim">
        Docker 使用简介
      </a>
    </h1>
    <div class="nested-links f5 lh-copy nested-copy-line-height">
      <p><code>Docker</code> 是使用 <code>GoLang</code> 开发的开源容器引擎，可以方便的打包开发好的应用，然后分发到任意 <code>linux</code> 主机上。</p>
<p>与传统的虚拟机相比拥有以下优势：</p>
<ul>
<li>
<p>高效的系统资源利用率</p>
<p>由于不需要进行硬件虚拟和运行完整的操作系统等额外开销，无论是应用执行速度、内存损耗或者文件存储速度， <code>Docker</code> 都更加高效</p>
</li>
<li>
<p>更快的启动速度</p>
<p><code>Docker</code> 容器应用直接运行与宿主内核，无需启动完整的操作系统，可以做到秒级启动</p>
</li>
</ul>
    </div>
  </div>

        </div>
      
        <div class="relative w-100 w-30-l mb4 bg-white">
            <div class="mb3 pa4 mid-gray overflow-hidden">
    
      <div class="f6">
        四月 13, 2019
      </div>
    
    <h1 class="f3 near-black">
      <a href="/post/influxdb-introduction/" class="link black dim">
        InfluxDB 简介
      </a>
    </h1>
    <div class="nested-links f5 lh-copy nested-copy-line-height">
      <p><code>InfluxDB</code> 是一个时间序列数据库(<code>TSDB</code>), 被设计用来处理高写入、高查询负载，是 <a href="https://www.influxdata.com/time-series-platform/">TICK</a> 的一部分。</p>
<p><code>TSDB</code> 是针对时间戳或时间序列数据进行优化的数据库，专门为处理带有时间戳的度量和事件或度量而构建的。
而时间序列数据可以是随时间跟踪、监视、下采样和聚合的度量或事件，如服务器指标、应用程序性能、网络数据、传感器数据以及许多其他类型的分析数据。</p>
    </div>
  </div>

        </div>
      
        <div class="relative w-100 w-30-l mb4 bg-white">
            <div class="mb3 pa4 mid-gray overflow-hidden">
    
      <div class="f6">
        四月 11, 2019
      </div>
    
    <h1 class="f3 near-black">
      <a href="/post/clean_invalid_branch_in_git/" class="link black dim">
        清理无用的 local branch
      </a>
    </h1>
    <div class="nested-links f5 lh-copy nested-copy-line-height">
      <p>在开发新功能或修复 <code>bug</code> 时, 会从 <code>master</code> 上新建 <code>branch</code> 来处理, 当完成后会将这个 <code>branch</code> 推送到 <code>origin</code> 中, 如:
<code>git push origin &lt;branch name&gt;:&lt;branch name&gt;</code>.</p>
<p><code>origin</code> 审核代码没有问题后就会 <strong>合并分支并删除</strong>, 但 <strong>本地</strong> 在 <code>git pull</code> 删除本地分支后, 仍能通过 <code>git branch -a</code> 看到这个 <code>branch</code> 的 <code>origin ref</code>.
日积月累之下本地就会有很多这样无用的 <code>branch ref</code>, 很是让人厌烦, 遂在此记录清理的方法.</p>
    </div>
  </div>

        </div>
      
        <div class="relative w-100 w-30-l mb4 bg-white">
            <div class="mb3 pa4 mid-gray overflow-hidden">
    
      <div class="f6">
        四月 5, 2019
      </div>
    
    <h1 class="f3 near-black">
      <a href="/post/mysql_commands/" class="link black dim">
        MySQL 常用命令
      </a>
    </h1>
    <div class="nested-links f5 lh-copy nested-copy-line-height">
      <p>大学学的数据库系统概论工作后几年没有使用都已忘了, 现在项目需要用到数据库, 但来不及细看相关书籍了, 遂将一些常用的记录下来.</p>
<h2 id="常用类型">常用类型</h2>
<p><code>MySQL</code> 支持多种类型, 大致可以分为三类: 数值, 日期/时间和字符串(字符)类型, 大致如下:</p>
<ul>
<li>
<p>数值类型</p>
<ul>
<li>整数: <code>tinyint</code>, <code>smallint</code>, <code>mediumint</code>, <code>int</code>, <code>bigint</code></li>
<li>浮点数: <code>float</code>, <code>double</code>, <code>decimal</code></li>
</ul>
</li>
<li>
<p>日期和时间</p>
<p><code>date</code>, <code>time</code>, <code>datetime</code>, <code>timestamp</code>, <code>year</code></p>
</li>
<li>
<p>字符串类型</p>
<ul>
<li>字符串: <code>char</code>, <code>varchar</code></li>
<li>文本: <code>tinytext</code>, <code>text</code>, <code>mediumtext</code>, <code>longtext</code></li>
<li>二进制字符串: <code>tinyblob</code>, <code>blob</code>, <code>mediumblob</code>, <code>longblob</code></li>
</ul>
</li>
</ul>
<p>下面将详细给出每种类型的大小和描述.</p>
    </div>
  </div>

        </div>
      
        <div class="relative w-100 w-30-l mb4 bg-white">
            <div class="mb3 pa4 mid-gray overflow-hidden">
    
      <div class="f6">
        二月 2, 2019
      </div>
    
    <h1 class="f3 near-black">
      <a href="/post/hugo-github/" class="link black dim">
        使用 hugo 写博客
      </a>
    </h1>
    <div class="nested-links f5 lh-copy nested-copy-line-height">
      <p><a href="https://github.com/gohugoio/hugo">hugo</a> 是由 <code>Go</code> 语言实现的静态网站生成器, 简单、易用、高效、易扩展、快速部署。</p>
<h2 id="安装">安装</h2>
<p>到 <a href="https://github.com/gohugoio/hugo/releases">Release</a> 下载对应系统的二进制文件压缩包, 然后解压, 并把得到的二进制复制到 <code>Path</code> 中.</p>
<h2 id="简单使用">简单使用</h2>
<h3 id="创建一个站点">创建一个站点</h3>
<p>使用命令 <code>hugo new site &lt;dir&gt;</code> 来创建站点, 创建后的结构如下:</p>
    </div>
  </div>

        </div>
      
        <div class="relative w-100 w-30-l mb4 bg-white">
            <div class="mb3 pa4 mid-gray overflow-hidden">
    
      <div class="f6">
        十二月 5, 2018
      </div>
    
    <h1 class="f3 near-black">
      <a href="/post/gorm-association/" class="link black dim">
        gorm 关联查询
      </a>
    </h1>
    <div class="nested-links f5 lh-copy nested-copy-line-height">
      <p>定义了一个 <code>User</code> 和 <code>Company</code>, <code>User</code> 中可以包含多个 <code>Company</code>, 如下:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-go" data-lang="go"><span style="display:flex;"><span><span style="color:#66d9ef">type</span> <span style="color:#a6e22e">User</span> <span style="color:#66d9ef">struct</span> {
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">ID</span>        <span style="color:#66d9ef">int</span>        <span style="color:#e6db74">`gorm:&#34;TYPE:int(11);NOT NULL;PRIMARY_KEY;INDEX&#34;`</span>
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">Name</span>      <span style="color:#66d9ef">string</span>     <span style="color:#e6db74">`gorm:&#34;TYPE: VARCHAR(255); DEFAULT:&#39;&#39;;INDEX&#34;`</span>
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">Companies</span> []<span style="color:#a6e22e">Company</span>  <span style="color:#e6db74">`gorm:&#34;FOREIGNKEY:UserId;ASSOCIATION_FOREIGNKEY:ID&#34;`</span>
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">CreatedAt</span> <span style="color:#a6e22e">time</span>.<span style="color:#a6e22e">Time</span>  <span style="color:#e6db74">`gorm:&#34;TYPE:DATETIME&#34;`</span>
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">UpdatedAt</span> <span style="color:#a6e22e">time</span>.<span style="color:#a6e22e">Time</span>  <span style="color:#e6db74">`gorm:&#34;TYPE:DATETIME&#34;`</span>
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">DeletedAt</span> <span style="color:#f92672">*</span><span style="color:#a6e22e">time</span>.<span style="color:#a6e22e">Time</span> <span style="color:#e6db74">`gorm:&#34;TYPE:DATETIME;DEFAULT:NULL&#34;`</span>
</span></span><span style="display:flex;"><span>}
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">type</span> <span style="color:#a6e22e">Company</span> <span style="color:#66d9ef">struct</span> {
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">gorm</span>.<span style="color:#a6e22e">Model</span>
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">Industry</span> <span style="color:#66d9ef">int</span>    <span style="color:#e6db74">`gorm:&#34;TYPE:INT(11);DEFAULT:0&#34;`</span>
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">Name</span>     <span style="color:#66d9ef">string</span> <span style="color:#e6db74">`gorm:&#34;TYPE:VARCHAR(255);DEFAULT:&#39;&#39;;INDEX&#34;`</span>
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">Job</span>      <span style="color:#66d9ef">string</span> <span style="color:#e6db74">`gorm:&#34;TYPE:VARCHAR(255);DEFAULT:&#39;&#39;&#34;`</span>
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">UserId</span>   <span style="color:#66d9ef">int</span>    <span style="color:#e6db74">`gorm:&#34;TYPE:int(11);NOT NULL;INDEX&#34;`</span>
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div>
    </div>
  </div>

        </div>
      
    </aside>
    
    <ul class="pagination pagination-default">
      <li class="page-item">
        <a href="/post/" aria-label="First" class="page-link" role="button"><span aria-hidden="true">&laquo;&laquo;</span></a>
      </li>
      <li class="page-item">
        <a href="/post/" aria-label="Previous" class="page-link" role="button"><span aria-hidden="true">&laquo;</span></a>
      </li>
      <li class="page-item">
        <a href="/post/" aria-label="Page 1" class="page-link" role="button">1</a>
      </li>
      <li class="page-item active">
        <a aria-current="page" aria-label="Page 2" class="page-link" role="button">2</a>
      </li>
      <li class="page-item">
        <a href="/post/page/3/" aria-label="Page 3" class="page-link" role="button">3</a>
      </li>
      <li class="page-item">
        <a href="/post/page/4/" aria-label="Page 4" class="page-link" role="button">4</a>
      </li>
      <li class="page-item">
        <a href="/post/page/5/" aria-label="Page 5" class="page-link" role="button">5</a>
      </li>
      <li class="page-item">
        <a href="/post/page/3/" aria-label="Next" class="page-link" role="button"><span aria-hidden="true">&raquo;</span></a>
      </li>
      <li class="page-item">
        <a href="/post/page/6/" aria-label="Last" class="page-link" role="button"><span aria-hidden="true">&raquo;&raquo;</span></a>
      </li>
    </ul>
  </article>

    </main>
    <footer class="bg-black bottom-0 w-100 pa3" role="contentinfo">
  <div class="flex justify-between">
  <a class="f4 fw4 hover-white no-underline white-70 dn dib-ns pv2 ph3" href="https://jouyouyun.github.io" >
    &copy;  jouyouyun 2023 
  </a>
    <div>
<div class="ananke-socials">
  
    <a href="https://github.com/jouyouyun" target="_blank" class="github ananke-social-link link-transition stackoverflow link dib z-999 pt3 pt0-l mr1" title="GitHub link" rel="noopener" aria-label="follow on GitHub——Opens in a new window">
      
        <span class="icon"><svg style="enable-background:new 0 0 512 512;" version="1.1" viewBox="0 0 512 512"  xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" >
  <path d="M256,32C132.3,32,32,134.8,32,261.7c0,101.5,64.2,187.5,153.2,217.9c11.2,2.1,15.3-5,15.3-11.1   c0-5.5-0.2-19.9-0.3-39.1c-62.3,13.9-75.5-30.8-75.5-30.8c-10.2-26.5-24.9-33.6-24.9-33.6c-20.3-14.3,1.5-14,1.5-14   c22.5,1.6,34.3,23.7,34.3,23.7c20,35.1,52.4,25,65.2,19.1c2-14.8,7.8-25,14.2-30.7c-49.7-5.8-102-25.5-102-113.5   c0-25.1,8.7-45.6,23-61.6c-2.3-5.8-10-29.2,2.2-60.8c0,0,18.8-6.2,61.6,23.5c17.9-5.1,37-7.6,56.1-7.7c19,0.1,38.2,2.6,56.1,7.7   c42.8-29.7,61.5-23.5,61.5-23.5c12.2,31.6,4.5,55,2.2,60.8c14.3,16.1,23,36.6,23,61.6c0,88.2-52.4,107.6-102.3,113.3   c8,7.1,15.2,21.1,15.2,42.5c0,30.7-0.3,55.5-0.3,63c0,6.1,4,13.3,15.4,11C415.9,449.1,480,363.1,480,261.7   C480,134.8,379.7,32,256,32z"/>
</svg>
</span>
      
<span class="new-window"><svg  height="8px"  style="enable-background:new 0 0 1000 1000;" version="1.1" viewBox="0 0 1000 1000"  xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" >
<path d="M598 128h298v298h-86v-152l-418 418-60-60 418-418h-152v-86zM810 810v-298h86v298c0 46-40 86-86 86h-596c-48 0-86-40-86-86v-596c0-46 38-86 86-86h298v86h-298v596h596z" style="fill-rule:evenodd;clip-rule:evenodd;"/>
</svg>
</span></a>
  
</div>
</div>
  </div>
</footer>

  </body>
</html>
